/**
 * 
 */
package com.utn.ab.validate.util;


/**
 * @author zhailiang
 *
 */
public class ValidateCode {
	
	private String code;
	
	private Long expireTime;

	public ValidateCode() {
	}

	public ValidateCode(String code, int expireIn){
		this.code = code;
		this.expireTime = System.currentTimeMillis() + expireIn * 1000;
	}
	
	public ValidateCode(String code, Long expireTime){
		this.code = code;
		this.expireTime = expireTime;
	}
	
	public boolean isExpried() {
		return System.currentTimeMillis() > expireTime;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Long getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(Long expireTime) {
		this.expireTime = expireTime;
	}
}
